package views;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmMain.java
 *
 * Created on 17 mars 2010, 09:35:51
 */

import java.sql.SQLException;
import org.jdesktop.swingx.*;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Formation
 */
public class frmMain extends javax.swing.JFrame {

     public static JInternalFrame cadre;
     private Color gris=new Color(165,165,165);;

    /** Creates new form frmMain */
    public frmMain(String type)  {
        this.setTitle("Gestion touristique");
        initComponents();
        this.setLocationRelativeTo(this);
        this.setSize(1000, 700);    
        this.initAdmin();
    }
    
    private void initClient() {
        jMenuBar1.setVisible(false);
    }
    
    private void initAdmin() {
        jMenuBar1.setVisible(true);
        constructTaskBarClient();
        constructTaskBarReservation();
        constructTaskBarCircuit();
        constructTaskBarEtapes();
        constructTaskBarLieuAVisiter();
        this.setLocationRelativeTo(this);
        cadre = new JInternalFrame("",false,false,false,false);
        Image icon = Toolkit.getDefaultToolkit().getImage(getClass().getClassLoader().getResource("images/logoTourisme.png"));
        this.setIconImage(icon);
        try {
            affListClient();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }


    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jXTaskPaneContainer1 = new org.jdesktop.swingx.JXTaskPaneContainer();
        taskClient = new org.jdesktop.swingx.JXTaskPane();
        taskReservation = new org.jdesktop.swingx.JXTaskPane();
        taskCircuit = new org.jdesktop.swingx.JXTaskPane();
        taskEtapes = new org.jdesktop.swingx.JXTaskPane();
        taskLieuVisiter = new org.jdesktop.swingx.JXTaskPane();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        jInternalFrame1 = new javax.swing.JInternalFrame();
        jDesktopPane1 = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        menuCandidat = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        menuEntreprise = new javax.swing.JMenu();
        menuNewEntreprise = new javax.swing.JMenuItem();
        menuListEntreprise = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Gestion touristique");
        setBackground(new java.awt.Color(153, 255, 255));

        jXTaskPaneContainer1.setBackground(new java.awt.Color(0, 102, 153));
        org.jdesktop.swingx.VerticalLayout verticalLayout1 = new org.jdesktop.swingx.VerticalLayout();
        verticalLayout1.setGap(14);
        jXTaskPaneContainer1.setLayout(verticalLayout1);

        taskClient.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/candidat2.png"))); // NOI18N
        taskClient.setTitle("Candidat");
        jXTaskPaneContainer1.add(taskClient);

        taskReservation.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/commandes.png"))); // NOI18N
        taskReservation.setTitle("Réservation");
        jXTaskPaneContainer1.add(taskReservation);

        taskCircuit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/circuit.png"))); // NOI18N
        taskCircuit.setTitle("Circuit");
        jXTaskPaneContainer1.add(taskCircuit);

        taskEtapes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/circuit.png"))); // NOI18N
        taskEtapes.setTitle("Etapes");
        jXTaskPaneContainer1.add(taskEtapes);

        taskLieuVisiter.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/circuit.png"))); // NOI18N
        taskLieuVisiter.setTitle("Lieu à Visiter");
        jXTaskPaneContainer1.add(taskLieuVisiter);

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/quitter.png"))); // NOI18N
        jButton1.setText("Quitter l'application");
        jButton1.setAlignmentX(1.0F);
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        jInternalFrame1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jInternalFrame1.setFocusCycleRoot(false);
        jInternalFrame1.setVisible(true);

        javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
        jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
        jInternalFrame1Layout.setHorizontalGroup(
            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jInternalFrame1Layout.setVerticalGroup(
            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        menuCandidat.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/candidat2.png"))); // NOI18N
        menuCandidat.setText("Client");

        jMenuItem1.setText("Nouveau client");
        menuCandidat.add(jMenuItem1);

        jMenuItem2.setText("Lister les clients");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        menuCandidat.add(jMenuItem2);

        jMenuBar1.add(menuCandidat);

        menuEntreprise.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/commandes.png"))); // NOI18N
        menuEntreprise.setText("Réservation");

        menuNewEntreprise.setText("Nouvelle réservation");
        menuNewEntreprise.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                menuNewEntrepriseMousePressed(evt);
            }
        });
        menuEntreprise.add(menuNewEntreprise);

        menuListEntreprise.setText("Lister les réservations");
        menuListEntreprise.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                menuListEntrepriseMousePressed(evt);
            }
        });
        menuEntreprise.add(menuListEntreprise);

        jMenuBar1.add(menuEntreprise);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 952, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(219, 219, 219)
                .addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(733, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addComponent(jXTaskPaneContainer1, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
                    .addComponent(jXTaskPaneContainer1, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
        System.exit(0); //lorsqu'on clique sur Quitter, l'application se ferme
    }//GEN-LAST:event_jButton1MouseClicked

    public static void affInfoClient(String id) throws ClassNotFoundException, SQLException
    {
        frmClient frmClient = null;
        if (id == null) {
            frmClient = new frmClient();
        } else {
            frmClient = new frmClient(id);
        }
        
        frmClient.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Consultation /Modification d'un client",false,false,false,false);

        Container conteneur = cadre.getContentPane();
        conteneur.add(frmClient,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public static void affListClient() throws ClassNotFoundException, SQLException
    {
        frmListClient listClient = new frmListClient();
        listClient.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Lister les clients",false,false,false,false);

        Container conteneur = cadre.getContentPane();
        conteneur.add(listClient,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
    public static void affListCircuit() throws ClassNotFoundException, SQLException
    {
        frmListCircuit listCircuit = new frmListCircuit();
        listCircuit.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Lister les circuits",false,false,false,false);

        Container conteneur = cadre.getContentPane();
        conteneur.add(listCircuit,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
    public static void affInfoCircuit(String id) throws ClassNotFoundException, SQLException
    {
        frmCircuit frmCircuit = null;
        if (id == null) {
            frmCircuit = new frmCircuit();
        } else {
            frmCircuit = new frmCircuit(id);
        }
        
        frmCircuit.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Consultation /Modification d'un circuit",false,false,false,false);
        Container conteneur = cadre.getContentPane();
        conteneur.add(frmCircuit,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
     public static void affListEtapes() throws ClassNotFoundException, SQLException
    {
        frmListEtapes listEtapes = new frmListEtapes();
        listEtapes.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Lister les étapes",false,false,false,false);

        Container conteneur = cadre.getContentPane();
        conteneur.add(listEtapes,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
    public static void affInfoEtapes(String id) throws ClassNotFoundException, SQLException
    {
        frmEtapes frmEtapes = null;
        if (id == null) {
            frmEtapes = new frmEtapes();
        } else {
            frmEtapes = new frmEtapes(id);
        }
        
        frmEtapes.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Consultation /Modification d'une étape",false,false,false,false);
        Container conteneur = cadre.getContentPane();
        conteneur.add(frmEtapes,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
    
      public static void affListLieuAVisiter() throws ClassNotFoundException, SQLException
    {
        frmListLieu listLieuAVisiter = new frmListLieu();
        listLieuAVisiter.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Lister les lieux à visiter",false,false,false,false);

        Container conteneur = cadre.getContentPane();
        conteneur.add(listLieuAVisiter,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
    public static void affInfoLieuAVisiter(String id) throws ClassNotFoundException, SQLException
    {
        frmLieu frmLieu = null;
        if (id == null) {
            frmLieu= new frmLieu();
        } else {
            frmLieu = new frmLieu(id);
        }
        
        frmLieu.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Consultation /Modification d'un lieu à visiter",false,false,false,false);
        Container conteneur = cadre.getContentPane();
        conteneur.add(frmLieu,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    public static void affListReservation() throws ClassNotFoundException, SQLException
    {
        frmListReservation listReservation = new frmListReservation();
        listReservation.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Lister les Réservations",false,false,false,false);

        Container conteneur = cadre.getContentPane();
        conteneur.add(listReservation,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
    
     public static void affInfoReservation(String numcommande) throws ClassNotFoundException, SQLException
    {
        frmReservation frmReservation = null;
        if (numcommande == null) {
            frmReservation = new frmReservation();
        } else {
            frmReservation = new frmReservation(numcommande);
        }
        
        frmReservation.setVisible(true);
        cadre.dispose();
        cadre = new JInternalFrame("Consultation /Modification d'une réservation",false,false,false,false);
        Container conteneur = cadre.getContentPane();
        conteneur.add(frmReservation,BorderLayout.CENTER);
        cadre.pack();
        jDesktopPane1.add(cadre);
        cadre.setVisible(true);
        try {
              cadre.setMaximum(true);
        } catch (PropertyVetoException ex) {
              Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }


    private void menuNewEntrepriseMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuNewEntrepriseMousePressed
        
    }//GEN-LAST:event_menuNewEntrepriseMousePressed

    private void menuListEntrepriseMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuListEntrepriseMousePressed
        
    }//GEN-LAST:event_menuListEntrepriseMousePressed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    
    /**
     *
    * @param args the command line arguments
    */

    private void constructTaskBarClient() {      
    taskClient.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Nouveau client");
      putValue(Action.SHORT_DESCRIPTION,"Ajouter un client");
     // putValue(Action.SMALL_ICON, menuNewCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affInfoClient(null);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
    //Modifier client
    taskClient.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Lister les clients");
      putValue(Action.SHORT_DESCRIPTION, "Lister les clients");
    //  putValue(Action.SMALL_ICON, menuListCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affListClient();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }});
   
   }
    
     private void constructTaskBarReservation() {      
    taskReservation.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Nouvelle réservation");
      putValue(Action.SHORT_DESCRIPTION,"Créer une réservation");
     // putValue(Action.SMALL_ICON, menuNewCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affInfoReservation(null);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
          

    });
    //Modifier reservation
    taskReservation.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Lister les réservations");
      putValue(Action.SHORT_DESCRIPTION, "Lister les réservations");
    //  putValue(Action.SMALL_ICON, menuListCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affListReservation();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
    });
    //Supprimer client
   }

      private void constructTaskBarCircuit() {      
    taskCircuit.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Nouveau circuit");
      putValue(Action.SHORT_DESCRIPTION,"Créer un circuit");
     // putValue(Action.SMALL_ICON, menuNewCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affInfoCircuit(null);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
    //Modifier client
    taskCircuit.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Lister les circuits");
      putValue(Action.SHORT_DESCRIPTION, "Lister les circuits");
    //  putValue(Action.SMALL_ICON, menuListCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affListCircuit();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
    //Supprimer client
   }
    
private void constructTaskBarEtapes() {      
    taskEtapes.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Nouvelle étape");
      putValue(Action.SHORT_DESCRIPTION,"Créer une étape");
     // putValue(Action.SMALL_ICON, menuNewCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affInfoEtapes(null);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
   
    taskEtapes.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Lister les étapes");
      putValue(Action.SHORT_DESCRIPTION, "Lister les étapes");
    //  putValue(Action.SMALL_ICON, menuListCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affListEtapes();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
    
   }

private void constructTaskBarLieuAVisiter() {      
    taskLieuVisiter.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Nouveau Lieu à Visiter");
      putValue(Action.SHORT_DESCRIPTION,"Créer un lieu à visiter");
     // putValue(Action.SMALL_ICON, menuNewCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affInfoLieuAVisiter(null);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
   
    taskLieuVisiter.add(new AbstractAction() {
    {
      putValue(Action.NAME, "Lister les lieux à Visiter");
      putValue(Action.SHORT_DESCRIPTION, "Lister les lieux à visiter");
    //  putValue(Action.SMALL_ICON, menuListCandidat.getIcon());
    }

    public void actionPerformed(ActionEvent e) {
        try {
            affListLieuAVisiter();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(frmMain.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    });
    
   }
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new frmMain("").setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    public static javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JInternalFrame jInternalFrame1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JToolBar jToolBar1;
    private org.jdesktop.swingx.JXTaskPaneContainer jXTaskPaneContainer1;
    private javax.swing.JMenu menuCandidat;
    private javax.swing.JMenu menuEntreprise;
    public static javax.swing.JMenuItem menuListEntreprise;
    private javax.swing.JMenuItem menuNewEntreprise;
    private org.jdesktop.swingx.JXTaskPane taskCircuit;
    private org.jdesktop.swingx.JXTaskPane taskClient;
    private org.jdesktop.swingx.JXTaskPane taskEtapes;
    private org.jdesktop.swingx.JXTaskPane taskLieuVisiter;
    private org.jdesktop.swingx.JXTaskPane taskReservation;
    // End of variables declaration//GEN-END:variables

}
